#{extends 'layout.html' /}
#{set title:messages.get('crud.list.title', '订单信息表') /}


<script type="text/javascript" src="/public/javascripts/jquery-1.6.4.min.js"></script>
<link rel="stylesheet" href="/public/stylesheets/alert.css" type="text/css" />
<script type="text/javascript" src="/public/javascripts/adu.alert.js"></script>
<div id="crudList" class="${type.name}">

    <div id="crudListSearch">
        <form enctype="application/x-www-form-urlencoded" accept-charset="utf-8" method="get" action="/indents/list">        
        	<input type="text" value="" name="search"> <input type="submit" value="搜索">
		</form>
    </div>

    <div id="crudListTable">
        #{crud.table fields:['id','sysid','memid','indnum','indcon','indaddr','indmob','indsta','indproc','操作']}
        	#{crud.custom 'memid'}
        		${service.MemberService.findmem(object.memid)?.memnum}
        	#{/crud.custom}
        	#{crud.custom 'indsta'}
        		<a onclick="inds(${object.id},${object.indsta});" href="javascript:void(0);">${object.indsta == 1 ? "未处理":""}</a>
        		<a onclick="inds(${object.id},${object.indsta});" href="javascript:void(0);">${object.indsta == 2 ? "处理中":""}</a>
        		<a onclick="inds(${object.id},${object.indsta});" href="javascript:void(0);">${object.indsta == 3 ? "已发货":""}</a>
        		<a onclick="inds(${object.id},${object.indsta});" href="javascript:void(0);">${object.indsta == 4 ? "已取消":""}</a>
        		<a onclick="inds(${object.id},${object.indsta});" href="javascript:void(0);">${object.indsta == 5 ? "已付款":""}</a>
        		<a onclick="inds(${object.id},${object.indsta});" href="javascript:void(0);">${object.indsta == 6 ? "续借":""}</a>
        	#{/crud.custom}
        	#{crud.custom '操作'}
		        <table border="0">
		            <tr>
		                <td width="140%" style="text-align:center;" >
		                	
		                   	<a href="/controllers/Borrows.fborrow?id=${object.id}">详情</a>&nbsp;&nbsp;
		                   	<a href="/controllers/ExpressAction.findexpress?id=${object.id}">物流</a>&nbsp;&nbsp;
		                   	<a href="/controllers/Ordcoms.findordcoms?id=${object.id}">评论</a>
		                </td>
		                <td></td>
		            </tr>
		        </table>
	        #{/crud.custom}
        #{/crud.table }
    </div>

    <div id="crudListPagination">
        #{crud.pagination /}
    </div>

    <p style="display:none;" id="crudListAdd">
        <a href="@{blank()}">添加</a>
    </p>
	<script type="text/javascript">
		function inds(indid,indsta){
			 var  $div = "" ;
    	       $div="<div>订单状态：<input id='idstate' type='text' value='"+indsta+"' /><input style='margin-left:15px;' id='updatasta' type='button' value='修改' /><input id='indentid' type='hidden' value='"+indid+"' /></div>" 
			aduBox($div,"<font color='red'>订单状态修改</font>");
			$("#updatasta").click(function(){
				$.ajax({
					type:'post',
					url :'/controllers/MemberView.updataindst',
					data:({"indid":$("#indentid").val(),"istate":$("#idstate").val()}),
					dataType:'html',
					success:function(e){
						if(e == "1"){
							aduAlert("状态修改成功！","提示",function(){
								window.location.href = "/controllers/indents.list";
							});
						}
						if(e == "0"){
							aduAlert("状态修改失败！","提示");
						}
					}
				});
			});
		}
	</script>
</div>

